package org.ehe.business.supplier.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.ehe.business.engineer.domain.vo.EngineerEntityVO;
import org.ehe.business.supplier.domain.SupplierInfo;
import org.ehe.business.supplier.domain.bo.SupplierInfoBO;
import org.ehe.business.supplier.domain.dto.CreateSupplierRequest;
import org.ehe.business.supplier.domain.dto.SupplierQueryRequest;
import org.ehe.business.supplier.domain.dto.UpdateSupplierRequest;
import org.ehe.business.supplier.domain.vo.SupplierInfoVO;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;

import java.util.List;

/**
 * @author :zhangnn
 * @className :SupplierInfoService
 * @description: TODO
 * @date 2025-07-23 09:42:35
 */
public interface SupplierInfoService extends IService<SupplierInfo> {
    /**
     * 获取供应商列表信息
     * @param engineerBO
     * @return
     */
    TableDataInfo<SupplierInfoVO> getAllSuppliers(SupplierInfoBO engineerBO, PageQuery query);
    /**
     * 获取供应商详情
     * @param id
     * @return
     */
    SupplierInfoVO getSupplierDetail(Long id);

    /**
     * 新增供应商
     * @param request
     * @return
     */
    int createSupplier(CreateSupplierRequest request);

    /**
     * 修改供应商
     * @param request
     * @return
     */
    int updateSupplier(UpdateSupplierRequest request);


    /**
     * 删除供应商
     * @param id
     * @return
     */
    boolean deleteSupplier(Long id);

    /**
     * 批量删除供应商
     * @param ids
     * @return
     */
    boolean batchDeleteSuppliers(List<Long> ids);


    /**
     * 启用/暂停供应商
     * @param id
     * @param status
     * @return
     */
    boolean updateSupplierStatus(Long id, Integer status);

    /**
     * 获取供应商分类信息
     * @param id
     * @return
     */
    List<Long> getSupplierCategories(Long id);

    /**
     * 更新供应商关联信息
     * @param id
     * @param categoryIds
     * @return
     */
    int updateSupplierCategories(Long id, List<Long> categoryIds);

    boolean existsBySupplierCode(String supplierCode, Long excludeId);

    boolean existsBySocialCreditCode(String socialCreditCode, Long excludeId);

    /**
     * 供应商校验
     * @param supplierId
     */
    SupplierInfoVO validateSupplier(Long supplierId);
}
